<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN" dir="ltr">
<%@page import="java.sql.*"%>
<head profile="http://gmpg.org/xfn/11">
<title>Knowledge Share</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet" href="styles/layoutforprofilepage.css" type="text/css" />
       <script src="scripts/slidemenu.js"></script>
        <style type="text/css">
            
            #menu1 {
                background: #676767;
                height: auto;
                width:0px;  
                float:right;
                overflow:hidden;
            }
           /* #menu2 {
                background: #fff;
                height: 100%;
                width:0px;  
                float:right;
                overflow:hidden;
            }
			*/
           #nav-bar {
                background: #2B2B2B;
                height: 615px;
                width:30px; 
                float:right;
            }
            ul.nav-menu{
                padding:0px;
                margin:0;
            }
            ul.nav-menu li{
                list-style-type:none;
                padding:0px;
                width:10px;
                height:400px;
            }
            ul.nav-menu li a{
	display:block;
	width:100px;
	padding:5px;
	position:relative;
	right:42px;
	top:60px;
	color:#2B2B2B;
	text-decoration:none;
	background-color: #2B2B2B;
            }
            ul.nav-menu li a.btn-2{
                top:160px;
            }
            ul.nav-menu li a:hover{
                background-color:#676767;
                color:#2B2B2B;
            }
            
			.rotate {
                -webkit-transform: rotate(-90deg);  /* Safari */
               -moz-transform: rotate(-90deg);     /* Firefox */
                -ms-transform: rotate(-90deg);      /* IE */
                -o-transform: rotate(-90deg);       /* Opera */
                filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* Internet Explorer */
            }
        </style>
		
		<style type="text/css">
		#menu ul
{
    margin: 0px;
    padding: 0px;
    list-style-type: none;
}

#menu a
{
    display:inline-block;
    width: 230px;
	height:60px;
	padding-left:24px;
	padding-top:8px;
	text-transform:uppercase;
    color: white;
    background-color: #676767;
    text-align: left;
}

#menu a:hover
{
    background-color:#2B2B2B;
}
</style>

<script type="text/javascript">
function validate()
{
  if(document.f1.cgpa.value.length<1)
			{
				alert("Please enter CGPA ");
				return false;
			}
			if(document.f1.year.value.length<1)
			{
				alert("Please enter Year");
				return false;
			}
			if(document.f1.sec.value.length<1)
			{
				alert("Please enter Section");
				return false;
			}
			if(document.f1.achv.value.length<1)
			{
				alert("Please enter Achievements");
				return false;
			}

		return true;
}
</script>

</head>
<body id="top">
<div class="wrapper row1">
  <div id="topnav">
    <ul>
      	   <li style="float:right"><a href="logout.jsp"><strong>Log Out</strong></a></li>
    </ul> 
  </div>
</div>
<!-- ####################################################################################################### -->
<div class="wrapper row2">
  <div id="header" class="clear">
    <div class="fl_left">
      <h1><a href="sprofile.jsp">Knowledge Share </a></h1>
      <p>an online knowledge based community sharing system</p>
    </div>
  </div>
</div>
<!-- ####################################################################################################### -->
<div class="wrapper row4"></div>
<!-- ####################################################################################################### -->
<div class="wrapper row5">

        <div id="menu1">
		
		<div id="menu">
          <ul>
             <li><a href="startdisc.jsp">Start a Discussion</a></li>
             <li><a href="viewdisclist.jsp">View Discussions</a></li>
             <li><a href="videoupload.jsp">Upload Video Tutorials</a></li>
			 <li><a href="#">View Video Tutorials</a></li>
			 <li><a href="#">Upload Study Materials</a></li>
			 <li><a href="#">View Study Materials</a></li>
			 <li><a href="#">Live Sessions</a></li>
			 <li><a href="#">View Assessment report</a></li>
			 <li><a href="">Interact with Industry Expert</a></li>
		  </ul>
       </div>
		
		</div>
        <div id="nav-bar">
            <ul class="nav-menu">
                <li>
                <a name="nav" href="#" class="btn-1 rotate"><img src="images/sliderimg.jpg" width="100" height="30" /></a></li>
            </ul>
        </div><!--/nav-bar-->
        <script type="text/javascript">
            $(document).ready(function()
            {
                var $menu1 = $('#menu1');
                //var $menu2 = $('#menu2');

                $('.btn-1').toggle(
                function()
                {
                    if ($menu1.width() == 250)
                    {
                        $('#menu1').animate({width: "0"}, 500);
                    }
                    else {
                        //$('#menu2').animate({width:'0px'},500);
                        $('#menu1').delay(500).animate({width:'250px'},500);
                    } 
                },
                function()
                {
                    if ($menu1.width() == 250)
                    {
                        $('#menu1').animate({width: "0"}, 500);
                    }
                    else {
                        //$('#menu2').animate({width:'0px'},500);
                        $('#menu1').delay(500).animate({width:'250px'},500);
                    }
                });

             });
        </script>
  <div id="container" class="clear">
    <!-- ####################################################################################################### -->
    
     
      <img class="imgl" src="images/demo/140x120.gif" alt="" width="125" height="125" />
	  <form name="form1" action="imgupload.jsp" enctype="multipart/form-data" method="post">
<table width="283">
<tr><td align="center" colspan="3"><input type="submit" value="Upload Picture" align="center"></td></tr>
</table>
</form>
      <p></p>
     
	  <%!
	  String uid=null,gender=null,department=null,email=null,phno=null,dob=null,fname=null,lname=null;
	  %>
	  <%
	  uid=(String)session.getAttribute("id");
	  try{
		     Class.forName("com.mysql.jdbc.Driver");
		     Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/kbcssdb", "root", "mysql");
		     PreparedStatement pst = con.prepareStatement("Select * from userdetails where userid=?");  
		     pst.setString(1,uid);
		     ResultSet rs = pst.executeQuery();
		     
		     while(rs.next()){
		    	 fname=rs.getString("fname");
		    	 lname=rs.getString("lname");
		    	 gender=rs.getString("gender");
		    	 department=rs.getString("deptid");
		    	 email=rs.getString("email");
		    	 dob=rs.getString("dob");
		    	 phno=rs.getString("phno");
		     }
		     PreparedStatement pst1 = con.prepareStatement("Select * from studentdetails where userid=?");  
		     pst1.setString(1,uid);
		     ResultSet rs1 = pst1.executeQuery();
		     		     
	   
	  %>
      <p> WELCOME : <strong><%=fname+lname %></strong></p>
	  <p></p>
	  <h1>General Details</h1>
	   <table style="background-color:#CCCCCC; color:#000000">
	         <tr><td width="30%" style="padding-left:20px;">Gender</td><td width="70%" style="padding-left:20px;"><%=gender %></td></tr>
			 <tr><td width="30%" style="padding-left:20px;">Department</td><td width="70%" style="padding-left:20px;"><%=department %></td></tr>
			 <tr><td width="30%" style="padding-left:20px;">Email</td><td width="70%" style="padding-left:20px;"><%=email %></td></tr>
			 <tr><td width="30%" style="padding-left:20px;">Contact number</td><td width="70%" style="padding-left:20px;"><%=phno %></td></tr>
			 <tr><td width="30%" style="padding-left:20px;">Date Of Birth</td><td width="70%" style="padding-left:20px;"><%=dob %></td></tr>
	   
	   </table>
	   <%if(rs1.next()){
		   response.sendRedirect("sprofile1.jsp");
	   }else{
		%>
	  
	   <form name="f1" action="StuInfoInsert.do" method="post" onsubmit="return validate();"> 
	   <h1>Academic Details </h1>
	   <table style="background-color:#CCCCCC; color:#000000">
		    <tr><td width="30%">CGPA</td><td><input type="text" name="cgpa"></td></tr>
			<tr><td height="20">Year</td><td><input type="text" name="year"></td></tr>
			<tr><td height="20">Section</td><td><input type="text" name="sec"></td></tr>
			<tr><td>Achievements</td><td><textarea cols="100" name="achv"></textarea></td></tr>
			<tr><td></td><td><input type="submit" value="UPDATE"></td></tr>
	   </table>	  
	   </form>
	   <%
	   }
	  }catch(Exception e){
		    System.out.println(e);
	     }
	  session.setAttribute("dept", department);  
	   %>
	        
      
    
    <!-- ####################################################################################################### -->
  </div>
</div>
<!-- ####################################################################################################### -->
<div class="wrapper"></div>
<!-- ####################################################################################################### -->
<div class="wrapper">
  <div id="footer" class="clear">
    <!-- ####################################################################################################### -->
   
    <div id="copyright" class="clear">
      <p class="fl_left">Copyright &copy; 2012 - All Rights Reserved</p>
      <p class="fl_right">Team CodeX</p>
    </div>
    <!-- ####################################################################################################### -->
  </div>
</div>
</body>
</html>